package com.hyb.service.impl;

import com.hyb.mapper.ItemsMapper;
import com.hyb.pojo.Items;
import com.hyb.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;

import java.util.List;

@Service
public class ItemsServiceImpl implements ItemsService{
    @Autowired
    ItemsMapper itemsMapper;


    @Override
    public List<Items> getAll(ModelMap maps) {

        return itemsMapper.selectAll(maps);

    }

    @Override
    public List<Items> quartzGetAll() {
        return itemsMapper.quartzSelectAll();
    }

    @Override
    public void add(Items items) {
        itemsMapper.add(items);
    }

    @Override
    public void update(Items items) {
        itemsMapper.update(items);
    }

    @Override
    public Items getById(int id) {
        Items items=new Items();
        items.setId(id);
        return itemsMapper.selectById(items);
    }

    @Override
    public void delete(int id) {
        itemsMapper.delete(id);
    }

}
